package Eyjafjalla.card.skill;

import Eyjafjalla.card.AbstractEyjafjallaCard;
import Eyjafjalla.power.PrepareDiscardPower;
import Eyjafjalla.power.PrepareDrawPower;
import com.megacrit.cardcrawl.actions.common.ApplyPowerAction;
import com.megacrit.cardcrawl.actions.common.GainBlockAction;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import com.megacrit.cardcrawl.localization.CardStrings;
import com.megacrit.cardcrawl.monsters.AbstractMonster;

public class PrepareBeforeCamp_Eyjafjalla extends AbstractEyjafjallaCard {
    public static final String ID = "PrepareBeforeCamp_Eyjafjalla";
    private static final CardStrings cardStrings;

    public PrepareBeforeCamp_Eyjafjalla(){
        super(ID, cardStrings.NAME,1,cardStrings.DESCRIPTION,CardType.SKILL,CardRarity.UNCOMMON,CardTarget.SELF);
        this.baseBlock = 7;
        this.block = 7;
        setFireDescription(cardStrings.EXTENDED_DESCRIPTION[0]);
    }

    @Override
    public AbstractCard makeCopy() {
        return new PrepareBeforeCamp_Eyjafjalla();
    }

    @Override
    public void use(AbstractPlayer p, AbstractMonster m) {
        addToBot(new GainBlockAction(p,this.block));
        addToBot(new ApplyPowerAction(p,p,new PrepareDrawPower(p,1),1));
        if(isFire()){
            addToBot(new ApplyPowerAction(p,p,new PrepareDiscardPower(p,1),1));
        }
    }

    @Override
    public void upgrade() {
        if(!this.upgraded){
            upgradeName();
            upgradeBlock(4);
        }
    }

    static {
        cardStrings = CardCrawlGame.languagePack.getCardStrings(ID);
    }
}


